Skip to content

Conversation

@jjroelofs
Copy link
Contributor

Summary

Adds a "View experiment" contextual link to Views blocks that use the AI Sorting sort plugin, allowing administrators to quickly navigate to the experiment detail page.

Changes

  • Implement hook_contextual_links_view_alter() in ai_sorting.module
  • Dynamically add the link only for views with ai_sorting sort enabled
  • Link navigates to /admin/reports/rl/experiment/{experiment_id}

Test plan

  • Navigate to a page with a Views block using AI Sorting
  • Hover over the block to reveal contextual links (pencil icon)
  • Click the pencil icon
  • Verify "View experiment" link appears in the menu
  • Click "View experiment" and verify it navigates to the correct experiment detail page

Closes #18

Add a "View experiment" link to the contextual menu of Views blocks
that use AI Sorting. This allows administrators to quickly navigate
from a Views block to its corresponding experiment detail page in
the RL module reports.

The link only appears for Views displays that have the ai_sorting
sort plugin enabled.
@jjroelofs jjroelofs merged commit 3380e0f into 1.x Jan 27, 2026
2 checks passed
@jjroelofs jjroelofs deleted the feature/contextual-link-view-experiment branch January 27, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add contextual link to view experiment from Views block

2 participants